<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" />
        <meta name="format-detection" content="telephone=no" />
        <title>填写会员卡资料</title>
        <link href="__PUBLIC__/css/style.css" rel="stylesheet" type="text/css">
        <link href="__PUBLIC__/css/font-face.css" rel="stylesheet" type="text/css">
        <script type="text/javascript" src="http://libs.baidu.com/jquery/1.9.1/jquery.min.js"></script>
    </head>

    <body class="member_bg">
        <div class="member_top">
            <div class="member_banner"></div>
        </div>
        <div class="member_tips">以下信息将作为会员资料，请认真填写</div>
        <div class="signup_inp_box">
            <form action="{:U('member_card/resign')}" name='form_add' id='form_add' method="post">
                <div class="signup_inp_list">
                    <div class="signup_inp_list_layer"><span class="glyphicon glyphicon-user"></span></div>
                    <input type="text" onblur="if (this.value == '')
                                this.value = '姓名';" onfocus="if (this.value == '姓名')
                                            this.value = '';" name="user_name" value="姓名" >
                </div>
                <div style="line-height: 20px;margin-top: 5px;"><input type="radio" name="user_sex" checked="checked" value="0" />男&nbsp;&nbsp;<input type="radio" name="user_sex" value="1" />女</div>
                <div class="signup_inp_list">
                    <div class="signup_inp_list_layer"><span class="glyphicon glyphicon-calendar"></span></div>
                    <input type="text" onblur="if (this.value == '')
                                this.value = '出生日期1980-10-10';" onfocus="if (this.value == '出生日期1980-10-10')
                                            this.value = '';" name="user_birthday" value="出生日期1980-10-10">
                </div>
                <div class="signup_inp_list">
                    <div class="signup_inp_list_layer"><span class="glyphicon glyphicon-phone"></span></div>
                    <input type="text" onblur="if (this.value == '')
                                this.value = '电话';" onfocus="if (this.value == '电话')
                                            this.value = '';" name="user_telephone" value="电话">
                </div>
                <input type="hidden" value="{$weixin_id}" name='weixin_id' id='weixin_id'/>
                <div class="member_btn" id='member_btn'><a style="cursor: pointer;">保存我的会员卡信息</a></div>
            </form>
        </div>
        <script>
            $(function() {
                $('#member_btn').click(function() {
                    if (check_fields()) {
                        $('form').submit();
                    }
                });

                function check_fields() {
                    var obj = $('#form_add');
                    var user_name = obj.find("[name=user_name]");
                    var user_birthday = obj.find("[name=user_birthday]");
                    var user_telephone = obj.find("[name=user_telephone]");
                    if (user_name.val() == "姓名" || user_name.val() == '') {
                        user_name.val('');
                        alert('请填写您的姓名!');
                        user_name.focus();
                        return false;
                    }
                    if (user_birthday.val() == "出生日期1980-10-10" || user_birthday.val() == '') {
                        user_birthday.val('');
                        alert('请填写您的出生日期!');
                        user_birthday.focus();
                        return false;
                    }
                    if (user_telephone.val() == "电话" || user_telephone.val() == '') {
                        user_telephone.val('');
                        alert('请填写您的电话号码!');
                        user_telephone.focus();
                        return false;
                    }
                    return true;
                }
            });

        </script>
    </body>
</html>
